{template 'common/header'}
<link href="{EW_DELIVERT_STATIC}css/detail.css" rel="stylesheet">
<link href="{EW_DELIVERT_STATIC}css/classlist.css" rel="stylesheet">

<ul class="nav nav-tabs">
    <li><a href="{php echo $this->createWebUrl('goods', array('op'=>'display'));}">返回运单列表</a></li>
    <li {if $_GPC['op']=='display' || $_GPC['op']==''}class="active"{/if}><a href="{php echo $this->createWebUrl('detail', array('op'=>'display' , 'oid' => $_GPC['oid']));}">物流跟踪列表</a></li>
</ul>

    <div class="panel panel-default">
        <div class="panel-heading">运单跟踪列表-运单号：{php echo $orderId;}</div>
        <div class="panel-body">
            <div class="table-responsive panel-body">
                <table class="table table-hover table-bordered" style="min-width: 300px;" >
                    <thead class="navbar-inner" style="">
                        <tr >
                            <th style="width:200px;text-align: center;">时间</th>
                            <th style="width:500px;text-align: center;">地点和跟踪进度</th>
                            <th style="width:200px;text-align: center;">操作</th>
                        </tr>
                    </thead>
                    <tbody style="text-align: center;">
                        {loop $orderDetail $detail}
                        <tr>
                            <td>{php echo date('Y-m-d : H:i:s' , $detail['createdAt'])}</td>
                            <td>{$detail['progress']}</td>
                            <td>
                                <a href="javascript:#" data-url="{php echo $this->createWebUrl('detail', array('id'=>$detail['id'] , 'op' => 'delete'))}" class="btn btn-default btn-sm delete" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="删除"><i class="fa fa-times"></i>
                                </a>
                                <a href="{php echo $this->createWebUrl('detail', array('oid' => $id , 'op' => 'edit' , 'id' => $detail['id']));}" class="btn btn-default" data-toggle="tooltip" data-placement="top" title="" data-original-title="编辑"><i class="fa fa-pencil"></i></a>
                            </td>
                            </td>
                            </td>
                        </tr>
                        {/loop}
                        {if empty($orderDetail)}
                        <tr>
                            <td colspan="3">
                                尚未添加物流跟踪
                            </td>
                        </tr>
                        {/if}
                        <tr>
                            <td colspan="3">
                                <div class="td" style="width: 100%;">
                                    <a class="category_list_add" href="{php echo $this->createWebUrl('detail', array('op' => 'edit' , 'oid' => $id));}">添加物流跟踪信息</a>
                                    <div class="clear"></div>
                                </div>
                            </td>
                        </tr>

                    </tbody>
                </table>
                {$pager}
            </div>
        </div>
    </div>

<script>
    $('.delete').click(function(event) {
        var url = $(this).attr('data-url');
        if(confirm('确认删除？')){
           $.get(url , function(result){
                    if(result.status == 1){
                        util.message(result.msg,'','success')
                        setTimeout(
                                "window.location.reload()",
                                2000,
                            );
                    }else{
                        util.message(result.msg,'','error');
                    }
                }
                ,"json"
            );
        }else{
            return false;
        }
    });
</script>
{template 'common/footer'}